package com.ruoyi.base.domain;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 楼宇对象 base_building
 * 
 * @author yepanpan
 * @date 2020-11-09
 */
@ApiModel("楼宇实体")
@Getter
@Setter
public class BaseBuilding extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增长主键ID */
    private Long id;

    /** 代码 */
    @Excel(name = "代码", prompt = "必填项")
    @ApiModelProperty("代码")
    @NotBlank(message="代码不能为空")
    private String code;

    /** 名称 */
    @Excel(name = "名称", prompt = "必填项")
    @ApiModelProperty("名称")
    @NotBlank(message="名称不能为空")
    private String title;

    /** 类型 1=教学楼	2=宿舍楼	3=行政楼	4=综合楼 */
    @Excel(name = "类型", dictType = "building_type", prompt = "必填项", combo = {"教学楼","宿舍楼","行政楼","综合楼"})
    @ApiModelProperty("类型")
    @NotBlank(message="类型不能为空")
    private String type;

    /** 负责人 */
    @ApiModelProperty("负责人")
    @NotNull(message = "负责人不能为空")
    private Long masterUser;
    @Excel(name = "负责人工号", prompt = "必填项")
    private String tcode;
    @Excel(name = "负责人姓名", prompt = "必填项")
    private String tname;

    /** 启用日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("启用日期")
    @NotNull(message="启用日期不能为空")
    private Date startDate;

    /** 停用日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "停用日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("停用日期")
    private Date endDate;

    /** 状态 */
    @Excel(name = "状态", dictType = "common_status", combo = {"启用","禁用"})
    @ApiModelProperty("状态")
    @NotBlank(message="状态不能为空")
    private String status;


	@Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("title", getTitle())
            .append("type", getType())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("status", getStatus())
            .toString();
    }
}
